/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SComplaintConverter.java
 * Created：		2016年8月21日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.repair.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.commons.entity.UCN;
import com.thor.palmmall.rest.repair.AProcessRecord;
import com.thor.palmmall.spi.maintain.SProcessRecord;

/**
 * @author wolv
 *
 */
public class SProcessRecordConverter implements Converter<AProcessRecord, SProcessRecord> {

	public static SProcessRecordConverter getInstance() {
		if (instance == null)
			instance = new SProcessRecordConverter();
		return instance;
	}

	private static SProcessRecordConverter instance;

	private SProcessRecordConverter() {
	}

	@Override
	public SProcessRecord convert(AProcessRecord source) {
		if (source == null)
			return null;

		SProcessRecord target = new SProcessRecord();
		target.setContent(source.getContent());
		target.setOperator(UCN.newInstance(source.getOperator()));
		target.setOperatorTime(source.getOperatorTime());

		return target;
	}
}
